home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: news.sprintlink.net!eskimo!news
- From: mag@eskimo.com (mAg)
- Subject: Re: strange problem with strcpy()
- X-Nntp-Posting-Host: tia1.eskimo.com
- Message-ID: <DKHzHF.4wF@eskimo.com>
- Sender: news@eskimo.com (News User Id)
- Organization: *.*
- X-Newsreader: WinVN 0.93.10
- References: <DKFsII.FyJ@iglou.com>
- Date: Mon, 1 Jan 1996 10:22:25 GMT
-
- In article <DKFsII.FyJ@iglou.com> (Sun, 31 Dec 1995 05:56:41 GMT), quare@iglou2.iglou.com
- says :
- >
- >Some background. tc++ 3.0 for dos. Basically I have this routine that
- >reads in files from the current directory and makes an malloc'ed array of
- >structures which hold info about those files (attribs, filename/ext, size,
- >etc.). More detailed info on request.
- >
- >Anyway, this routine uses a pointer to write to this 'array'. (as in:
- >pointer->name, pointer->size, etc.). strcpy(pointer->name,
- >fileinfo->name) (fileinfo is the structure written to by the dos service)
- >*sometimes* works, yet sometimes it will place a \0 in the first position
- >of pointer->name. for example..
- >
- >if fileinfo->name == "test.c", strcpy will place "\0est.c" into
- >pointer->name. Any clues as to how this is happening? And no,
- >pointer->name was not "test.c" before the call to strcpy(). Please... I
- >beg of you... :(
- >
-
- Eventhough the above text tells about the problem you are having, many C gurus here on clc
- will be able to help you better if you post the code.
-
- >--
- >!quare
- >
-
- --
- /* --------------------------------------------------------
- MAG@ESKIMO.COM
- http://www.eskimo.com/~mag/index.html
- ***********************************************************
- To understand recursion one must first understand recursion
- ***********************************************************
- -------------------------------------------------------- */
-
-